const path = require("path");
const { dealModule } = require("./config.util");
module.exports = {
    entry: {
        "main": path.join(__dirname, "..", "js/initial.js"),
    },
    output: {
        path: path.join(__dirname, "../dist"),
        filename: '[name].js'
    },
    mode: "development",
    module: {
        rules: [
            {
                test: /\.(js|jsx)$/, // 预留 React。
                exclude: /(node_modules)/,
                use: [
                    {
                        loader: dealModule("babel-loader"),
                        options: {
                            ...require("./babel.config")
                        }
                    }
                ]
            },
            {
                test: /\.(css|scss)$/, // 预留 React。
                exclude: /(node_modules)/,
                use: [
                    dealModule("style-loader"),
                    dealModule("css-loader"),
                    dealModule("sass-loader"),
                ]
            }
        ]
    },
    plugins: [

    ]
}